package com.coder.books.thinkinjava.gui;

import java.util.concurrent.TimeUnit;

import javax.swing.JFrame;
import javax.swing.JLabel;

/**
 *
 * @author yuhushuan
 * @date 2020/9/7 11:13
 */
public class HelloLabel {
    public static void main(String[] args) throws InterruptedException {
        JFrame frame = new JFrame("Hello Swing");
        JLabel label = new JLabel("A Label");
        frame.add(label);
        frame.add(new JLabel("1"));
        frame.add(new JLabel("2"));
        frame.add(new JLabel("3"));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300,300);
        frame.setVisible(true);
        TimeUnit.SECONDS.sleep(2);
        label.setText("Hey! This is Different!");
    }
}
